package cn.com.huzo.model.entities.trade;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 售货合同主记录实体类
 * <p>
 * @author 范学春
 */
public class SalesContractHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 7112644457735020284L;
    private Long HeaderId;
    private String NoOfContract;               // 合同号
    private Integer TheBuyingParty;
    private String TheBuyingPartyName;
    private Integer TheSellingParty;
    private String TheSellingPartyName;
    private String PlaceOfSigning;
    private String MoreOrLessAllowed;
    private Timestamp DateOfContract;
    private Timestamp TimeOfShipment;
    private String LoadingPort;
    private String Destination;
    private String CargoInsurance;
    private Integer ModeOfSettlementId;
    private String ModeOfSettlementName;
    private Integer CurrencyId;
    private String CurrencyName;
    private String PackingBox;
    private String Brand;
    private String Other;

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getNoOfContract() {
        return NoOfContract;
    }

    public void setNoOfContract(String NoOfContract) {
        this.NoOfContract = NoOfContract;
    }

    public Integer getTheBuyingParty() {
        return TheBuyingParty;
    }

    public void setTheBuyingParty(Integer TheBuyingParty) {
        this.TheBuyingParty = TheBuyingParty;
    }

    public String getTheBuyingPartyName() {
        return TheBuyingPartyName;
    }

    public void setTheBuyingPartyName(String TheBuyingPartyName) {
        this.TheBuyingPartyName = TheBuyingPartyName;
    }

    public Integer getTheSellingParty() {
        return TheSellingParty;
    }

    public void setTheSellingParty(Integer TheSellingParty) {
        this.TheSellingParty = TheSellingParty;
    }

    public String getTheSellingPartyName() {
        return TheSellingPartyName;
    }

    public void setTheSellingPartyName(String TheSellingPartyName) {
        this.TheSellingPartyName = TheSellingPartyName;
    }

    public String getPlaceOfSigning() {
        return PlaceOfSigning;
    }

    public void setPlaceOfSigning(String PlaceOfSigning) {
        this.PlaceOfSigning = PlaceOfSigning;
    }

    public String getMoreOrLessAllowed() {
        return MoreOrLessAllowed;
    }

    public void setMoreOrLessAllowed(String MoreOrLessAllowed) {
        this.MoreOrLessAllowed = MoreOrLessAllowed;
    }

    public String getLoadingPort() {
        return LoadingPort;
    }

    public void setLoadingPort(String LoadingPort) {
        this.LoadingPort = LoadingPort;
    }

    public String getDestination() {
        return Destination;
    }

    public void setDestination(String Destination) {
        this.Destination = Destination;
    }

    public String getCargoInsurance() {
        return CargoInsurance;
    }

    public void setCargoInsurance(String CargoInsurance) {
        this.CargoInsurance = CargoInsurance;
    }

    public Integer getModeOfSettlementId() {
        return ModeOfSettlementId;
    }

    public void setModeOfSettlementId(Integer ModeOfSettlementId) {
        this.ModeOfSettlementId = ModeOfSettlementId;
    }

    public String getModeOfSettlementName() {
        return ModeOfSettlementName;
    }

    public void setModeOfSettlementName(String ModeOfSettlementName) {
        this.ModeOfSettlementName = ModeOfSettlementName;
    }

    public Integer getCurrencyId() {
        return CurrencyId;
    }

    public void setCurrencyId(Integer CurrencyId) {
        this.CurrencyId = CurrencyId;
    }

    public String getCurrencyName() {
        return CurrencyName;
    }

    public void setCurrencyName(String CurrencyName) {
        this.CurrencyName = CurrencyName;
    }

    public String getPackingBox() {
        return PackingBox;
    }

    public void setPackingBox(String PackingBox) {
        this.PackingBox = PackingBox;
    }

    public String getBrand() {
        return Brand;
    }

    public void setBrand(String Brand) {
        this.Brand = Brand;
    }

    public String getOther() {
        return Other;
    }

    public void setOther(String Other) {
        this.Other = Other;
    }

    public void setDateOfContract(Timestamp DateOfContract) {
        this.DateOfContract = DateOfContract;
    }

    public void setTimeOfShipment(Timestamp TimeOfShipment) {
        this.TimeOfShipment = TimeOfShipment;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfContract() {
        return DateOfContract;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getTimeOfShipment() {
        return TimeOfShipment;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof SalesContractHeaderEntity)) {
            return false;
        }

        final SalesContractHeaderEntity that = (SalesContractHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
